<?php

namespace app\admin\model;

use app\common\model\BaseModel;


class WeekSpecial extends BaseModel
{

    

    

    // 表名
    protected $name = 'week_special';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    //状态处理
    public static function fetchStatus($status = null){
        $data =  [
            1 => '启用',
            2 => '禁用',
        ];
        if (isset($data[$status])) {
            return $data[$status];
        }else{
            return $data;
        }
    }

    //周处理
    public static function fetchWeek($week = null){
        $data =  [
            0 => '周日',
            1 => '周一',
            2 => '周二',
            3 => '周三',
            4 => '周四',
            5 => '周五',
            6 => '周六',
        ];
        if (isset($data[$week])) {
            return $data[$week];
        }else{
            return $data;
        }
    }






}
